package test.xml.entity;

import java.util.List;

import com.thoughtworks.xstream.annotations.XStreamAlias;
import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
import com.thoughtworks.xstream.annotations.XStreamImplicit;

@XStreamAlias("DataBase")
public class DataBase {
	@XStreamAsAttribute()
	private String id;
	
	@XStreamAsAttribute()
	private String datasourceId;

	@XStreamAsAttribute()
	private String databaseName;
	
	@XStreamImplicit()
	private List<Table> tables;
	
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getDatasourceId() {
		return datasourceId;
	}

	public void setDatasourceId(String datasourceId) {
		this.datasourceId = datasourceId;
	}

	public String getDatabaseName() {
		return databaseName;
	}

	public void setDatabaseName(String databaseName) {
		this.databaseName = databaseName;
	}

	public List<Table> getTables() {
		return tables;
	}

	public void setTables(List<Table> tables) {
		this.tables = tables;
	}

	@Override
	public String toString() {
		StringBuilder builder = new StringBuilder();
		builder.append("DataBase [id=");
		builder.append(id);
		builder.append(", datasourceId=");
		builder.append(datasourceId);
		builder.append(", databaseName=");
		builder.append(databaseName);
		builder.append(", tables=");
		builder.append(tables);
		builder.append("]");
		return builder.toString();
	}
	
}
